#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<QLabel>
#include<QProgressBar>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QStatusBar* statusBar = this->statusBar();
    this->setStatusBar(statusBar);

    //显示一个临时信息
    //statusBar->showMessage("临时信息", 3000);

    //给状态栏添加子控件
    QLabel* label = new QLabel("label!");
    //statusBar->addWidget(label, 1);//拉伸系数为1

    QLabel* label2 = new QLabel("label!!");
    //statusBar->addWidget(label2, 2);

    QProgressBar* progressBar = new QProgressBar();
    progressBar->setRange(0, 100);
    progressBar->setValue(50);
    statusBar->addWidget(progressBar);


}

MainWindow::~MainWindow()
{
    delete ui;
}

